// Package wechat 的 Mock 实现：用于 --test 启动模式下返回模拟结果
package wechat

import (
    "time"
)

// MockClient 提供 API 接口的模拟实现
type MockClient struct{}

func NewMockClient() *MockClient { return &MockClient{} }

func (m *MockClient) SendCashCoupon(req SendCashCouponRequest) (*SendCashCouponResponse, error) {
    return &SendCashCouponResponse{
        ReturnCode: "SUCCESS",
        ReturnMsg:  "OK",
        ResultCode: "SUCCESS",
        CouponID:   req.CouponID,
        SendTime:   time.Now().Format(time.RFC3339),
        SendNo:     "MOCKSENDNO",
    }, nil
}

func (m *MockClient) CreateDiscountActivity(req CreateDiscountActivityRequest) (*CreateDiscountActivityResponse, error) {
    return &CreateDiscountActivityResponse{ReturnCode: "SUCCESS", ReturnMsg: "OK", ResultCode: "SUCCESS", ActivityID: "MOCK-ACT-001", CreateTime: time.Now().Format(time.RFC3339)}, nil
}

func (m *MockClient) CreateRandomDiscount(req CreateRandomDiscountRequest) (*CreateRandomDiscountResponse, error) {
    return &CreateRandomDiscountResponse{ReturnCode: "SUCCESS", ReturnMsg: "OK", ResultCode: "SUCCESS", ActivityID: "MOCK-RAND-001", CreateTime: time.Now().Format(time.RFC3339)}, nil
}

func (m *MockClient) QueryTransactionByOutTradeNo(mchID, outTradeNo string) (*QueryTransactionResponse, error) {
    return &QueryTransactionResponse{ReturnCode: "SUCCESS", ReturnMsg: "OK", ResultCode: "SUCCESS", OutTradeNo: outTradeNo, TradeState: "SUCCESS", TimeEnd: time.Now().Format(time.RFC3339)}, nil
}

func (m *MockClient) UploadNumberPackage(req UploadNumberPackageRequest) (*UploadNumberPackageResponse, error) {
    return &UploadNumberPackageResponse{ReturnCode: "SUCCESS", ReturnMsg: "OK", ResultCode: "SUCCESS", PackageID: "MOCK-PKG-001", UploadTime: time.Now().Format(time.RFC3339)}, nil
}

func (m *MockClient) ListNumberPackageUsers(packageID string, offset, limit int) (*ListNumberPackageUsersResponse, error) {
    return &ListNumberPackageUsersResponse{ReturnCode: "SUCCESS", ReturnMsg: "OK", ResultCode: "SUCCESS", TotalCount: 1, UserList: []struct{ OpenID string "json:\"openid\""; CreateTime string "json:\"create_time\"" }{{OpenID: "mock-openid", CreateTime: time.Now().Format(time.RFC3339)}}}, nil
}


